<!DOCTYPE html>
<html lang="zh">
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        .slider {
            position: relative;
            width: 600px;
            height: 400px;
            overflow: hidden;
        }
        .slider img {
            width: 100%;
            height: 100%;
            display: none;
            position: absolute;
        }
    </style>
    </head>
    <body>
        <div class="header">
            <h1>花店展览</h1>
        </div>
    <div class="slider">
        <img src="img1.jpg" alt="Image 1">
        <img src="img2.jpg" alt="Image 2">
        <img src="img3.jpg" alt="Image 3">
    </div>
    
    <script>
        let currentIndex = 0;
        const images = document.querySelectorAll('.slider img');
        const totalImages = images.length;
    
        function showImage(index) {
            images.forEach(img => img.style.display = 'none');
            images[index].style.display = 'block';
        }
    
        function nextImage() {
            currentIndex = (currentIndex + 1) % totalImages;
            showImage(currentIndex);
        }
    
        // 设置轮播间隔
        setInterval(nextImage, 1000);
    
        // 初始化轮播
        showImage(currentIndex);
    </script>
    
    </body>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>花店展览</title>
    <style>
        /* CSS样式 */
        body {
            font-family: Arial, sans-serif;
        }
        .header {
            background-color: #f7f7f7;
            color: #333;
            text-align: center;
            padding: 20px;
        }
        .nav {
            float: left;
            width: 20%;
            background: #f2f2f2;
            padding: 15px;
        }
        .nav ul {
            list-style-type: none;
            padding: 0;
        }
        .nav ul a {
            text-decoration: none;
        }
        .content {
            float: right;
            width: 80%;
            padding: 15px;
        }
        .footer {
            clear: both;
            text-align: center;
            padding: 10px;
            background-color: #6ef184ee;
        }
        body {
            display: flex; /* 使用Flexbox布局 */
            justify-content: center; /* 水平居中 */
            align-items: center; /* 垂直居中 */
            height: 100vh; /* 使容器高度充满整个视口 */
            margin: 0; /* 移除默认的外边距 */
        }

        img {
            max-width: 100%; /* 图片最大宽度为容器宽度，保持图片比例 */
            height: auto; /* 图片高度自动调整，保持比例 */
        }
    </style>
</head>
<body>
 
 
<div class="nav">
    <ul>
        <li><a href="h2.html">首页</a></li>
        <li><a href="h3.html">花卉分类</a></li>
    </ul>
</div>
 
<div class="content">
    <!-- 花卉展览的具体内容 -->
    <h2>新品推荐</h2>
    <p>玫瑰</p>
    <img src="img4.jpg" alt="ni">
</div>
</body>
</html>